UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vkeIjwsXz/zSV1d1omtqTrREY9s6sUsphHaqxiYUwZw='
WHERE
key_id = 'a3c94f3ce1cdeffbb15adfd1b3714480b32dbcfff8f4ab1b613a568cfa9d57d2'
AND (
token = 'vkeIjwsXz/zSV1d1omtqTrREY9s6sUsphHaqxiYUwZw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)