UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'axqaUuDEG8t1RV6zTpAa7Ecc88U0jAnh+qD7CC16Jz0='
WHERE
key_id = '7cffaa190a0de32c7d8999acef525e3aade7422515914c411913dc30874a1acd'
AND (
token = 'axqaUuDEG8t1RV6zTpAa7Ecc88U0jAnh+qD7CC16Jz0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)