UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Oyi3d6/6bF8yP3un5/mF7rXaGuQCbJJK4k6nBxT2rlk='
WHERE
key_id = 'ed1a92f7b209499e60dd296ec53d091a8a92af5dd8f95ae1998cc73c9fa214f1'
AND (
token = 'Oyi3d6/6bF8yP3un5/mF7rXaGuQCbJJK4k6nBxT2rlk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)