UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eO1yV0weJbkesWq4Xu0Xyw0kOsO1MPI6YSfbddk7M/4='
WHERE
key_id = 'b48138ece6b047622f9992b7185338c05e29fe653357293ceb2db263abb9127e'
AND (
token = 'eO1yV0weJbkesWq4Xu0Xyw0kOsO1MPI6YSfbddk7M/4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)