UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wsaE7L0vQKjLIJeJ6YxvMsg/gnCJUWOrenGlQnJfxVw='
WHERE
key_id = 'cd4cfdc81234dd575ff7b2a6f591aa5d1a82c6871ca106e7645dd8439daa96f0'
AND (
token = 'wsaE7L0vQKjLIJeJ6YxvMsg/gnCJUWOrenGlQnJfxVw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)