UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6p4/uy3gOJu2kRvKhE2qh4C1k97S8bGx9gRkrwqH0AM='
WHERE
key_id = 'af2d38b189991a995560e68b2d98eda7ce75d0eca26a5be5042714ce30e34808'
AND (
token = '6p4/uy3gOJu2kRvKhE2qh4C1k97S8bGx9gRkrwqH0AM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)