UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RZ3SkaZkPgHzFYzIcRSNgN9s1/18q2a79X7+Xj0Ve64='
WHERE
key_id = '3819903a6b98a15848ec79ffc12299b0be8433c2befd7a2a9e15188c621418c7'
AND (
token = 'RZ3SkaZkPgHzFYzIcRSNgN9s1/18q2a79X7+Xj0Ve64='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)