UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RCpKdX1oN1pxBAjonCua4LblRLTu2SXKHD8ZAkYy4lA='
WHERE
key_id = 'e42889839fc32a00a6c5d6c693363d16a5bf9f8535b860944b19e6719561f312'
AND (
token = 'RCpKdX1oN1pxBAjonCua4LblRLTu2SXKHD8ZAkYy4lA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)