UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ge1ufa3pWeTsQz84DoFcQctwhlT3QwWigk1iJKcr3kE='
WHERE
key_id = '78ae574c916de079572455dfb97c25a3fd882f7cf5032c3a5ade4de5cd4561e5'
AND (
token = 'Ge1ufa3pWeTsQz84DoFcQctwhlT3QwWigk1iJKcr3kE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)