UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RDYr/2u4+rQhB4fW19+cQLW8RefFZEgqG9fv6gqZQZ4=' 
WHERE 
  key_id = '5a0ccdcacc92ea41e236b704f981a7ea553c35c1177babe3cafbe98a1a836e28' 
  AND (
    token = 'RDYr/2u4+rQhB4fW19+cQLW8RefFZEgqG9fv6gqZQZ4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033