UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qcfJjubZGn7GYmPCzibBo7CWi8KAxX8+Q0h24LItIdc='
WHERE
key_id = 'eac5ed47a933ea10608454338092d964d71298acfdaf098e2f3ba82bde62d6f5'
AND (
token = 'qcfJjubZGn7GYmPCzibBo7CWi8KAxX8+Q0h24LItIdc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)