UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iDPr8bIMKl52Pp1Ua76en3dgGcT40rqfjI4aXUCai34='
WHERE
key_id = 'add582f4116efd69eaf0f861fe910371acb3061cba82e361bd083962c863d0ac'
AND (
token = 'iDPr8bIMKl52Pp1Ua76en3dgGcT40rqfjI4aXUCai34='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)