UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mYbRslRLnS4C99Wxa31Glb02plvuTaZklUe298zsXbk='
WHERE
key_id = 'ae9132a163bc79a5b3babf1a03a38b4ec70fd8c947d1be963c92b957d0324f8f'
AND (
token = 'mYbRslRLnS4C99Wxa31Glb02plvuTaZklUe298zsXbk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)