UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '58/oPq3wC9jHyQCUj2s2ZyhwtIEJj0lEhdVcykZyS8Q='
WHERE
key_id = '99519038bd0b5ac9ce4772834e68b33a5aed51f5bd86e86649ec34a3d85a041c'
AND (
token = '58/oPq3wC9jHyQCUj2s2ZyhwtIEJj0lEhdVcykZyS8Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)