UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bnVifQOley+0AzIl/tiUC0PaMsitlnbrNHJ1kOcPjcE=' 
WHERE 
  key_id = '446f9699cc06add415ee70778d5a7be3644ddcc0bc639dd18ba0a1fcd79ad823' 
  AND (
    token = 'bnVifQOley+0AzIl/tiUC0PaMsitlnbrNHJ1kOcPjcE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029