UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aCiSV9BgSDdoBdDZTG7BUa1SQrXGvKxUzGcH9FmuXig='
WHERE
key_id = '065f842413793ee977bbed54afad9dfceac07576545ea5d81a15ea1982897513'
AND (
token = 'aCiSV9BgSDdoBdDZTG7BUa1SQrXGvKxUzGcH9FmuXig='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)