UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ti4vQnVMMacSpMAtOF5nQCslulQoNiS3zIiywBJ+1no=' 
WHERE 
  key_id = 'eeb3b27e85f5af35df4a16531ece47206c695fe1b1bc07eabad46b6b98d34089' 
  AND (
    token = 'Ti4vQnVMMacSpMAtOF5nQCslulQoNiS3zIiywBJ+1no=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042