UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PyWQZCNpMJFhlCWZ2VWTCytFj6qbgBl3fiTPkWT7ibM='
WHERE
key_id = '630b48048cf13140883765b9d935edd5600817ec069f501f63c04035ce7d0aa0'
AND (
token = 'PyWQZCNpMJFhlCWZ2VWTCytFj6qbgBl3fiTPkWT7ibM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)