UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vDJTl4+sFvIOwHB0UTXPqjWrld5Zd0YrMBKD4Q3AO7k=' 
WHERE 
  key_id = '405f70d93700dbe25f2d71c24b53aaaf65d518d4ab64b71632b9d0792cf92e92' 
  AND (
    token = 'vDJTl4+sFvIOwHB0UTXPqjWrld5Zd0YrMBKD4Q3AO7k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034