UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '68nrEaQNE8hbgEowOAhtmglle6BOLlZCFBL8VIEolZ4=' 
WHERE 
  key_id = '81803088e1741dceb2eaa6a80fe277b41cd12186d3e57e9d064f86747399a566' 
  AND (
    token = '68nrEaQNE8hbgEowOAhtmglle6BOLlZCFBL8VIEolZ4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026