UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xa+FtY0LzpLgEWGAPbDbaB6QsJ0DnF2O0EB35HBL1Fg='
WHERE
key_id = 'b43c84a510e92e92b73b623c394e198979d3078ba541476844b3c88c255a0213'
AND (
token = 'xa+FtY0LzpLgEWGAPbDbaB6QsJ0DnF2O0EB35HBL1Fg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)