UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2sCkaMtuxuUZ6AKhSkgiB2lIqU0pIRNkzZKdfEg5MO4='
WHERE
key_id = '02b319148abf2416245bf4781eba5a1ba0d73fc3bd337685a2b5d715acaf2d5f'
AND (
token = '2sCkaMtuxuUZ6AKhSkgiB2lIqU0pIRNkzZKdfEg5MO4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)