UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DawWkmQlBbWH8pAVeFDFgDHImwdWl9UQTZRJ438111E='
WHERE
key_id = '400d61a79c4f976c219e9d19ebf238f6ec9bb96f373431515be6980606df968b'
AND (
token = 'DawWkmQlBbWH8pAVeFDFgDHImwdWl9UQTZRJ438111E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)