UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pb/G3cBwOqVAXlMCVj0ppd6tiQQ9r1K51W5alh95ogM='
WHERE
key_id = 'f44eff49e2e907693d2015c927e9cccdf578dfb531da91bb21b5c7456662203e'
AND (
token = 'pb/G3cBwOqVAXlMCVj0ppd6tiQQ9r1K51W5alh95ogM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)