UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'A5G7mKJ0WkkuSlj2+nuWugS3I69aM3aVyxAgaqjcXnA=' 
WHERE 
  key_id = '0674500cc4eaea095d74e676c3b6e97fe8d3ce380efcb0a0d856fc886ba77770' 
  AND (
    token = 'A5G7mKJ0WkkuSlj2+nuWugS3I69aM3aVyxAgaqjcXnA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029