UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mnkLU5YblIi3a4AhLGGRjGwvfIwPjR03IOtuppvFOPc=' 
WHERE 
  key_id = '41eb187af54a4a702776ceca018545af37c8482d50a3f6a08811ccb1d431a3e5' 
  AND (
    token = 'mnkLU5YblIi3a4AhLGGRjGwvfIwPjR03IOtuppvFOPc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029