UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a+lupkQRirlFqS02NjxR/P9lMspV5ij+UuD6t9Yz5lI='
WHERE
key_id = '5c852f020c01fd4bbe739bb6585a7925ddbc9c7a5912de982d628cdcddf56049'
AND (
token = 'a+lupkQRirlFqS02NjxR/P9lMspV5ij+UuD6t9Yz5lI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)