UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EHy2GrzdmwREKD9UNYL4Vm5aLkNmF3VzJbNg29lgm64=' 
WHERE 
  key_id = '9061f188b9aed32c3c1b6eeec45a32db71cebf35f91f760cf89f67c12569b5ee' 
  AND (
    token = 'EHy2GrzdmwREKD9UNYL4Vm5aLkNmF3VzJbNg29lgm64=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038