UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6vSN1Qfh6cQbmUgZkJBxJ9RGPLr+vhfNZCSByBwyGrU='
WHERE
key_id = 'b0b30af2ee6ba463f803e257b6a057833dc958acd29d28d0b25de3219c27854b'
AND (
token = '6vSN1Qfh6cQbmUgZkJBxJ9RGPLr+vhfNZCSByBwyGrU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)