UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bleXVdKzMpcB1H4nnrDpi7LE4TAkbgDbgcBC+f0bYpI=' 
WHERE 
  key_id = 'bba057cec8fe59bc610bcb2dccfd029cfe87e7cb7bb07970bf2baba56f19fd64' 
  AND (
    token = 'bleXVdKzMpcB1H4nnrDpi7LE4TAkbgDbgcBC+f0bYpI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031