UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fbXgc7WOOI49fAjytIHtAMR30cNTIyYBO7m0Cmxw/Ic='
WHERE
key_id = 'f6af9aff262120ca01f70a4000d17b9e728ac0d806e5819d947bc8a923424e69'
AND (
token = 'fbXgc7WOOI49fAjytIHtAMR30cNTIyYBO7m0Cmxw/Ic='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)