UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x528xH+irSPVn0Aq0fDqBNkh1u0Zx2jwqtko0XtmNrw=' 
WHERE 
  key_id = 'b1ceae56cd3236d61e89e56dcb6148023782e8895a6c75c2637ea3006e070fe4' 
  AND (
    token = 'x528xH+irSPVn0Aq0fDqBNkh1u0Zx2jwqtko0XtmNrw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043