UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0oCuo4g5W8jRtNYnNedW0cT/2uy/hn5SE5VZvjUzPp4='
WHERE
key_id = '6688b30f2b3554a5a18895695e2831a42bb5b35a56eb18a84630737a2d81cc47'
AND (
token = '0oCuo4g5W8jRtNYnNedW0cT/2uy/hn5SE5VZvjUzPp4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)