UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YxzDq5LOLmybWfelXA6arHceBwDI3+w671ujztc3rvk='
WHERE
key_id = '849d8aad80d26664a5e98f3d6d3574f63c3b11453c764499c1561cd86e4098e6'
AND (
token = 'YxzDq5LOLmybWfelXA6arHceBwDI3+w671ujztc3rvk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)