UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9DJvG5Z+Q2nMOHoHGeqcUcHR7S9m9J2kgJAG4/aNAgk='
WHERE
key_id = 'f6f68e0334fe7f9cb0e5ea1cf383a84c05f6ce00f36553f32000d0e11c5243ad'
AND (
token = '9DJvG5Z+Q2nMOHoHGeqcUcHR7S9m9J2kgJAG4/aNAgk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)