UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6KN/mhgNbGEqc55dAcpLH8lRh236Dk+bOx9fZn2uwWA='
WHERE
key_id = 'ca4b5c09520be34edf12c7402c4940af55d4ffdf77696fc48b21dd70a3b04a7c'
AND (
token = '6KN/mhgNbGEqc55dAcpLH8lRh236Dk+bOx9fZn2uwWA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)