UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ImsyTrzSH5+OyL/PRTWtbJcUMNJSPOVuwMiwZ1L404s='
WHERE
key_id = '673f91a81879f41bdcb5201a73051af13464852196560ac2d230f68e1df84a52'
AND (
token = 'ImsyTrzSH5+OyL/PRTWtbJcUMNJSPOVuwMiwZ1L404s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)