UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KFwGscH25KdLbRNa+JqzrXV464ux27rKZEZA5ZlHsQU='
WHERE
key_id = 'a28108fe142fb9e0e324061def8cbb21d29e6b6f67e16b6cb08d683c0f47ae69'
AND (
token = 'KFwGscH25KdLbRNa+JqzrXV464ux27rKZEZA5ZlHsQU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)