UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cDVQ/sqgo5btd1kAF8MVD3+EhtQfjYPjX+CfCwoRBD4=' 
WHERE 
  key_id = '0f278614b6c0dde9ede1aa14bba09a2ba6829814218d5aba11f7b47cebc73bac' 
  AND (
    token = 'cDVQ/sqgo5btd1kAF8MVD3+EhtQfjYPjX+CfCwoRBD4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057